package com.virgo.demo.system.service;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService;
import com.virgo.demo.system.domain.SystemResourceDo;
import com.virgo.demo.system.domain.bo.SystemResourceBo;
import jakarta.servlet.http.HttpServletRequest;

import java.util.HashMap;
import java.util.List;

public interface SystemResourceService extends IService<SystemResourceDo> {

	/**
	 * 根据key查找
	 * @param rightKey String
	 * @return SystemResourceDo
	 */
	SystemResourceDo loadByRightKey(String rightKey);

	/**
	 * 编辑权限节点
	 * @param systemResourceBo SystemResourceBo
	 */
	void saveSystemResource(SystemResourceBo systemResourceBo);

	/**
	 * 删除权限节点
	 * @param ids String
	 */
	void deleteSystemResource(String ids);

	/**
	 * 权限节点树
	 * @return List<Tree<Long>>
	 */
	List<Tree<Long>> resourceTree(HttpServletRequest request);

    /**
     * 菜单权限数据
     * @param roleId Long
     * @return List<String>
     */
    List<String> menuData(Long roleId);

    /**
     * 按钮权限数据
     * @param roleId Long
     * @return List<String>
     */
    HashMap<String, Object> buttonData(Long roleId);
}